﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ebMS3dotnet.Core.Configuration
{
    [ConfigurationCollection(typeof(EndpointElement), AddItemName = "endpoint", CollectionType = ConfigurationElementCollectionType.BasicMap)]
    class EndpointCollection:ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new EndpointElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((EndpointElement)element).ID;
        }

        protected override string ElementName
        {
            get
            {
                return "endpoint";
            }
        }

        public override ConfigurationElementCollectionType CollectionType
        {
            get
            {
                return ConfigurationElementCollectionType.BasicMap;
            }
        }

        internal new EndpointElement this[string id]
        {
            get
            {
                return (EndpointElement)BaseGet(id);
            }
        }
    }
}
